package com.pingba.dao.msg;

import com.pingba.dao.BaseDao;
import com.pingba.entity.User;
import com.pingba.entity.msg.MsgApply;
import com.pingba.entity.msg.MsgSend;
import com.pingba.view.apply.MsgSendWithApplyInfoView;
import org.springframework.stereotype.Repository;

import javax.crypto.MacSpi;
import java.util.List;

/**
 * Created by Administrator on 2015/11/30 0030.
 */
@Repository
public interface MsgApplyDao extends BaseDao<MsgApply, Long> {
    void updateStatus(MsgApply apply);
    void setReaded(User msgOwner);
    List<MsgApply> getUnReadList(User msgOwner);
    List<MsgApply> getMsgSendApplies(MsgSend msgSend);
    List<MsgApply> myApplies(User user);
    List<MsgSendWithApplyInfoView> myApplyWithMsgSend(User me);


    /**
     * 删除该用户id下的该条msgApplyId
     * @param msgApplyId msgApply中的id
     * @param applicantId 用户id
     * @return
     */
    void deleteMyMsgApply(long msgApplyId, long applicantId);

    void deleteMsgSendApplies(long msgSendId, long ownerId);
}
